<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>

<div class="box">

<c:if test="${user.uname!=null and section.sid!=null}">
<div class="box-header">
创建新话题

</div>
<div class="inner row">
<!--<div class='alert alert-info'>如果标题已经包含你想说的话，内容可以留空。</div>-->
<form accept-charset="UTF-8" action="topic!addTopic?user.uid=${user.uid}&section.sid=${section.sid} " 
id="new_topic" method="post"  name="add_new" enctype="multipart/form-data">
<a name="new_topic"></a>
<s:token/>
<div class="form-group">
<div class="col-md-6">
<label for="topic_title">标题</label>
<input class="form-control" id="topic_title" name="ttopic" type="text"
data-toggle="popover" data-placement="bottom" data-content="标题应不少于六个字符">
</div>
</div>
<div class="form-group">
<div class="col-md-12" id="textContain" 
 data-toggle="popover" data-placement="top" data-content="内容不少于六个字符.">
<textarea class="form-control" id="topic_content" name="tcontents"  rows="10" style="width:770;height:240px;"
></textarea>
</div>
</div>
<div class="col-sm-9">
<input class="btn btn-primary"  type="submit" value="创建">
<small class="gray">(支持 Ctrl + Enter 快捷键)</small>
</div>
</form>
</div>
 <script type="text/javascript" charset="utf-8" src="${pageContext.request.contextPath}/ueditor/umeditor.config.js"></script>
<script type="text/javascript" charset="utf-8" src="${pageContext.request.contextPath}/ueditor/umeditor.min.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/ueditor/lang/zh-cn/zh-cn.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/js/topic.js"></script>


<script type="text/javascript">
    //实例化编辑器
    //建议使用工厂方法getEditor创建和引用编辑器实例，如果在某个闭包下引用该编辑器，直接调用UE.getEditor('editor')就能拿到相关的实例
       //实例化编辑器
    var um = UM.getEditor('topic_content');
 </script>
</c:if>
<c:if test="${user.uname==null}">
<div class="box-header">
<div class="pull-right">
<a href="#top" class="dark back_to_top">回到顶部</a>
</div>
现在就添加一条回复
</div>
<div class="inner row">
<div style="text-align: center;">
<p>欢迎访问开心吧社区</p>
<p><a class="btn btn-default" href="user!login">登录发表</a></p>
<p><a href="user!ureg">还没有账号？去注册</a></p>
</div>
 </div>
</c:if>
</div>

<div id="msg"></div>